package com.c.ctgproject.ui.review.part

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentStatePagerAdapter
import androidx.lifecycle.ViewModelProvider
import com.c.ctgproject.R
import com.c.ctgproject.adapter.BaseFragmentStatePagerAdapter
import com.c.ctgproject.base.BaseActivity
import com.c.ctgproject.fragment.review.material.AgreeMaterialFragment
import com.c.ctgproject.fragment.review.material.RefuseMaterialFragment
import com.c.ctgproject.fragment.review.material.WaitMaterialFragment
import com.c.ctgproject.fragment.review.part.AgreePartsFragment
import com.c.ctgproject.fragment.review.part.RefusePartsFragment
import com.c.ctgproject.fragment.review.part.WaitPartsFragment
import com.c.ctgproject.mode.MyConstants
import kotlinx.android.synthetic.main.activity_part_review.mTabLayout
import kotlinx.android.synthetic.main.activity_part_review.mViewPager

/**
 *作者:LiBW
 *创建日期: 2020/9/9
 *描述: 配件销售审核
 */
class PartReviewActivity : BaseActivity() {
    override fun getLayout() = R.layout.activity_part_review

    override fun event() {
        changeTransparentStatusBar()
        changeStatusIconColor(true)
        val titles = arrayOf("待审核", "已同意", "已拒绝")
        val fragmentList = ArrayList<Fragment>()
        fragmentList.add(WaitPartsFragment())
        fragmentList.add(AgreePartsFragment())
        fragmentList.add(RefusePartsFragment())
        mTabLayout.setupWithViewPager(mViewPager)
        mViewPager.adapter = BaseFragmentStatePagerAdapter(titles, fragmentList, supportFragmentManager, FragmentStatePagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT)
    }

    //是否用于纯展示
    fun getType(): Boolean {
        return intent.getBooleanExtra(MyConstants.JUST_SHOW, false)
    }
    override fun click() {

    }

}